import java.util.ArrayList;
import java.util.Collections;
class Array_02{
  public static void main(String args[]){
    /*
    ArrayList 操作
    */
    ArrayList<String> ArrayList = new ArrayList<String>();

    ArrayList.add("item01"); 
    ArrayList.add("item02"); 
    System.out.println("item:"+ ArrayList);

    ArrayList.add("item03"); 
    ArrayList.add("item04"); 
    System.out.println("item:"+ ArrayList);
    
    //ArrayList.remove(3);
    ArrayList.remove("item02");
    System.out.println("item:"+ ArrayList);

    
    ArrayList.add("item02"); 
    System.out.println("item:"+ ArrayList);

    //ArrayList.sort(c);
    Collections.sort(ArrayList);
    System.out.println("item:"+ ArrayList);

    //数组循环
    for(int i=0;i<ArrayList.size();i++){
      System.out.println(ArrayList.get(i));
    }


  }
}